﻿using System;
using DapperExtensions.Mapper;
using Newtonsoft.Json;

namespace ZilLion.Service.WeChatMall.Domain.Entitys.ShopInfo
{
    public class OfflineShopRelationshipEntity
    {
        /// <summary>
        ///     商户ID（使用微信APPID作为商户ID）
        /// </summary>
        [JsonProperty("zlcompanykey")]
        public string Zlcompanykey { get; set; }

        /// <summary>
        ///     货品id
        /// </summary>
        [JsonProperty("shopid")]
        public long ShopId { get; set; }

        /// <summary>
        ///     线下货品id
        /// </summary>
        [JsonProperty("offlineshopid")]
        public long OfflineShopid { get; set; }

        /// <summary>
        ///     修改时间
        /// </summary>
        [JsonProperty("updatedtime")]
        public DateTime UpdatedTime { get; set; }

        /// <summary>
        ///     修改人
        /// </summary>
        [JsonProperty("updater")]
        public long Updater { get; set; }
    }

    public class OfflineShopRelationshipEntityMapper : ClassMapper<OfflineShopRelationshipEntity>
    {
        public OfflineShopRelationshipEntityMapper()
        {
            Table("offlineshoprelationship");
            Map(f => f.Zlcompanykey).Column("zlcompanykey").Key(KeyType.Assigned);
            Map(f => f.ShopId).Column("shopid").Key(KeyType.Assigned);
            Map(f => f.OfflineShopid).Column("offlineshopid").Key(KeyType.Assigned);
            Map(f => f.UpdatedTime).Column("updatedtime");
            Map(f => f.Updater).Column("updater");
        }
    }
}